<template>
  <div id="orderDetail">
    <module-title :title="moduleTitle"></module-title>
    <!-- <el-row :gutter="20" style="background-color: white">
      <el-col :span="16">
        <div class="grid-content bg-purple">
          <p>工单号：</p>
          <p>创建时间：</p>
        </div>
      </el-col>
      <el-col :span="8">
        <div class="grid-content bg-purple">
          <el-button type="primary">返回</el-button>
        </div>
      </el-col>
    </el-row> -->
    <el-card>
      <el-form :inline="true" class="demo-form-inline">
        <el-col :span="8"
          ><div class="grid-content bg-purple">工单号：{{ rowData.workId }}</div></el-col
        >
        <el-col :span="8"
          ><div class="grid-content bg-purple">创建时间：{{ rowData.createTime }}</div></el-col
        >
        <el-col :span="8"
          ><div class="grid-content bg-purple button1">
            <el-button type="primary" plain class="title" @click="backOff" round>返回</el-button>
          </div></el-col
        >
      </el-form>
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        :header-cell-style="{
          background: '#d9d9d9',
          color: 'rgb(16, 116, 253)',
        }"
      >
        <el-table-column prop="account" label="账号"> </el-table-column>
        <el-table-column prop="online" label="状态"><template slot-scope="scope">{{scope.row.online ? '在线' : '离线'}}</template></el-table-column>
        <el-table-column prop="effectiveFans" label="有效进粉"> </el-table-column>
        <el-table-column prop="fans" label="总进粉"> </el-table-column>
        <el-table-column prop="loginTime" label="本次上线时间"> </el-table-column>
        <el-table-column prop="lastLoginTime" label="上线时间/下线时间">
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import ModuleTitle from "@/components/content/ModuleTitle.vue";
import API from "@/network/api/smsApi";

export default {
  name: "orderDetail",
  data() {
    return {
      moduleTitle: "工单详情",
      tableData: [],
      rowData: null,
      orderParam: {
        account: '',
        workId: '',
        pageSize: 10,
        pageNum: 1,
        startTime: '',
        endTime: ''
      },
    };
  },
  components: {
    ModuleTitle,
  },
  created() {
    this.rowData = this.$store.state.dataRow
    this.orderParam.workId = this.rowData.workId
    console.log(this.rowData);
  },
  mounted() {
    API.getWorkAccountInfo(this.orderParam).then(res => {
      console.log(res);
      if (res.data.code === 0) {
        this.tableData = res.data.data.records
      }
    })
  },
  methods: {
    backOff() {
      this.$router.back();
    }
  },
};
</script>

<style scoped>
.demo-form-inline {
  margin-bottom: 45px;
}

.button1 {
  text-align: right;
}

.title {
  width: 100px;
  margin-top: -7px;
}
</style>